<form class="form-horizontal" name="activate_form" ng-submit="do_submit()">
    <div class="modal-header">
        <a class="close" ng-click="close()" ng-show="!loading">×</a>
        <h5>{{ title }}</h5>
    </div>
    <div class="modal-body">
        <fieldset>
            <legend>基本配置</legend>
            <div class="row-fluid">
                <div class="span8">
                    <div class="control-group">
                        <label class="control-label">名称：</label>

                        <div class="controls">
                            <input type="text" required ng-model="host.host_name" placeholder="主机名称"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">IP：</label>

                        <div class="controls">
                            <input type="text" disabled="disabled" ng-model="host.ip" placeholder="IP"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">SSH密码：</label>

                        <div class="controls">
                            <input type="password" disabled="disabled" ng-model="host.password" placeholder="SSH密码"/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">集群：</label>

                        <div class="controls">
                            <select ng-options="c.name for c in clusters" ng-disabled="action=='$update'" class="span8" required ng-model="host.cluster">

                            </select>
                        </div>
                    </div>

                    <table width="100%">
                        <tr>
                            <td>
                                <div class="control-group">
                                    <label class="control-label">远程管理卡：</label>

                                    <div class="controls">
                                        <select class="span10 input-small" ng-model="host.powertool">
                                            <option value="0" selected="selected">选择管理卡</option>
                                            <option value="1">dell drac5</option>
                                            <!--<option value="2">hp</option>
                                            <option value="3">ibm</option> -->
                                        </select>
                                    </div>
                                </div>
                            </td>
                            <td>
                                <div class="control-group">
                                    <label class="control-label">管理卡IP：</label>

                                    <div class="controls">
                                        <input type="text" class="input-small" ng-disabled="host.powertool=='0'" ng-model="host.powercard_address"
                                               placeholder="管理IP"/>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div class="control-group">
                                    <label class="control-label">管理卡用户名：</label>

                                    <div class="controls">
                                        <input type="text" class="input-small" ng-disabled="host.powertool=='0'" ng-model="host.powercard_username"
                                               placeholder="管理卡用户名"/>
                                    </div>
                                </div>
                            </td>
                            <td>
                                <div class="control-group">
                                    <label class="control-label">管理卡密码：</label>

                                    <div class="controls">
                                        <input type="password" class="input-small" ng-disabled="host.powertool=='0'" ng-model="host.powercard_password"
                                               placeholder="管理卡密码"/>
                                    </div>
                                </div>
                            </td>
                        </tr>

                    </table>
                    <div class="control-group">
                        <label class="control-label">开启内存共享(KSM)：</label>

                        <div class="controls">
                            <input type="checkbox" ng-model="host.memshare"/>
                        </div>
                    </div>

                </div>
                <div class="span4">

                </div>
            </div>
        </fieldset>

    </div>
    <div class="modal-body">
        <fieldset>
            <legend>数据网络配置</legend>
            <label style="padding-left: 21px;"><i class="icon-info-sign"></i>数据网络配置将用于NAT网络</label>
            <!-- begin 网络IP配置 -->
            <div class="control-group">
            <label for="name" class="control-label">使用DHCP：</label>

                <div class="controls">
                    <input type="checkbox" class="input-mini ng-pristine ng-valid" ng-model="host.usedhcp">
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">ip：</label>

                <div class="controls">
                    <input type="text" class="input" ng-required="!host.usedhcp" ng-model="host.address" ng-disabled="host.usedhcp"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">网关：</label>

                <div class="controls">
                    <input type="text" class="input" ng-required="!host.usedhcp" ng-model="host.gateway"  ng-disabled="host.usedhcp"/>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">掩码：</label>

                <div class="controls">
                    <input type="text" class="input" ng-required="!host.usedhcp" ng-model="host.netmask"  ng-disabled="host.usedhcp"/>
                </div>
            </div>
           <div class="control-group">
                <label class="control-label">dns：</label>

                <div class="controls">
                    <input type="text" class="input" ng-disabled="host.usedhcp" ng-model="host.dns1"/>
                </div>
            </div>
           <!--  <div class="control-group">
                <label class="control-label">dns2：</label>

                <div class="controls">
                    <input type="text" class="input" required ng-model="host.dns2"/>
                </div>
            </div>-->
            <!-- end 网络IP配置 -->
        </fieldset>

    </div>
    <div class="modal-footer">
        <a data-dismiss="modal" ng-show="!loading" class="btn" ng-click="close()">关闭</a>
        <img width="32" height="32" ng-show="loading" src="/static/images/loading-indicator.gif" title="创建中...">
        <button type="submit" ng-show="!loading" ng-disabled="!activate_form.$valid" class="btn btn-primary">保存</button>
    </div>
</form>